package com.atguigu.lease.web.app.service.impl;


import com.atguigu.lease.model.entity.*;
import com.atguigu.lease.model.enums.ItemType;
import com.atguigu.lease.model.enums.LeaseStatus;
import com.atguigu.lease.web.app.mapper.*;
import com.atguigu.lease.web.app.service.*;
import com.atguigu.lease.web.app.vo.apartment.ApartmentItemVo;
import com.atguigu.lease.web.app.vo.attr.AttrValueVo;
import com.atguigu.lease.web.app.vo.fee.FeeValueVo;
import com.atguigu.lease.web.app.vo.graph.GraphVo;
import com.atguigu.lease.web.app.vo.room.RoomDetailVo;
import com.atguigu.lease.web.app.vo.room.RoomItemVo;
import com.atguigu.lease.web.app.vo.room.RoomQueryVo;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liubo
 * @description 针对表【room_info(房间信息表)】的数据库操作Service实现
 * @createDate 2023-07-26 11:12:39
 */
@Service
@Slf4j
public class RoomInfoServiceImpl extends ServiceImpl<RoomInfoMapper, RoomInfo>
        implements RoomInfoService {
    @Autowired
    private RoomInfoMapper roomInfoMapper;
    @Autowired
    private ApartmentInfoService apartmentInfoService;
    @Autowired
    private LabelInfoService labelInfoService;
    @Autowired
    private GraphInfoService graphInfoService;
    @Autowired
    private AttrKeyService attrKeyService;
    @Autowired
    private FacilityInfoService facilityInfoService;
    @Autowired
    private LeaseTermService leaseTermService;
    @Autowired
    private PaymentTypeService paymentTypeService;
    @Autowired
    private FeeValueService feeValueService;
    @Override
    public void customPage(Page<RoomItemVo> page, RoomQueryVo queryVo) {
        roomInfoMapper.customSelectPage(page,queryVo);
    }

    @Override
    public void custPageById(Page<RoomItemVo> page, Long id) {
        roomInfoMapper.customSelectPageById(page,id);
    }

    @Override
    public RoomDetailVo getDetialById(Long id) {
        //1.查询RoomInfo
        RoomInfo roomInfo = roomInfoMapper.selectRoomById(id);
        if(roomInfo == null){
            return null;
        }
//        //2.查询ApartmentInfo
//        ApartmentInfo apartmentInfo = apartmentInfoService.selectApartmentById(id);
//        //3.查询LabelInfo
//        List<LabelInfo> labelInfoList = labelInfoService.selectLabelInfoById(id);
//        //4.查询GraphInfo
//        List<GraphInfo> graphInfoList = graphInfoService.getGraphInfoById(id);
//        //5.查询GraohVo
//        List<GraphVo> graphVoList = graphInfoService.getGraphVoById(id);
//        //6.查询AttrValueVo
//        List<AttrValueVo> attrValueVoList = attrKeyService.getAttrValueVoById(id);
//        //7.查询FacilityInfo
//        List<FacilityInfo> facilityInfoList = facilityInfoService.getFacilityInfoById(id);
//        //8.查询LeaseTerm
//        List<LeaseTerm> leaseTermList = leaseTermService.getLeaseTermById(id);
//        //9.查询paymentType
//        List<PaymentType> paymentTypeList = paymentTypeService.getPaymentTypeById(id);
//        //10.查询FeeValueVo
//        List<FeeValueVo> feeValueVoList = feeValueService.getFeeValueVoById(id);
        return null;
    }
}




